package com.heaven.customerServer.customerController;

import com.heaven.customerServer.customerController.vo.videoCategory.TreeNode;
import com.heaven.service.VideoCategoryService;
import com.heaven.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("heaven-server/video/category")
public class VideoCategoryController {
    @Autowired
    private VideoCategoryService videoCategoryService;

    @GetMapping("/list-tree")
    public R listTree() {
        List<TreeNode> ans = videoCategoryService.listCategoryTree();
        return R.okData(ans);
    }
}
